package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenGroupsMapper;
import com.server.pinggu.domain.SenGroups;
import com.server.pinggu.service.ISenGroupsService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenGroupsServiceImpl extends ServiceImpl<SenGroupsMapper, SenGroups> implements ISenGroupsService {

    @Override
    public List<SenGroups> queryList(SenGroups senGroups) {
        LambdaQueryWrapper<SenGroups> lqw = Wrappers.lambdaQuery();
        if (senGroups.getPid() != null){
            lqw.eq(SenGroups::getPid ,senGroups.getPid());
        }
        if (StringUtils.isNotBlank(senGroups.getName())){
            lqw.like(SenGroups::getName ,senGroups.getName());
        }
        if (senGroups.getOrdering() != null){
            lqw.eq(SenGroups::getOrdering ,senGroups.getOrdering());
        }
        if (senGroups.getIstrue() != null){
            lqw.eq(SenGroups::getIstrue ,senGroups.getIstrue());
        }
        return this.list(lqw);
    }
}